# -*- Mode: Python -*-

Import('env')

myenv = env.Clone()
#myenv.Append(CXXFLAGS = ' -finstrument-functions -DPROFILE')

crt0 = myenv.Object('crt0.o', 'arch/' + myenv['ARCH'] + '/crt0.S')
myenv.Install(myenv['LIBPATH'], crt0)

ccsrc = [Glob('*.cc'), Glob('*/*.cc'), Glob('*/' + myenv['ARCH'] + '/*.cc')]
csrc = [Glob('*.c'), Glob('*/*.c'), Glob('*/' + myenv['ARCH'] + '/*.c')]
ssrc = [Glob('arch/*.s'), Glob('*/' + myenv['ARCH'] + '/*.s')]
lib = myenv.StaticLibrary('libstdc++', ccsrc + csrc + ssrc)
myenv.Install(myenv['LIBPATH'], lib)
